package com.ctgu.蓝桥杯真题.B组2015;

import java.util.Vector;

/**
 * @author: Backdiy
 * @data: 2021/4/15 15:55
 * @desc:
 */
public class 循环节长度4 {
    public static void main(String[] args) {
        System.out.println(f(11, 13));
    }

    public static int f(int n, int m) {
        n = n % m;
        Vector v = new Vector();

        for (; ; ) {
            v.add(n);
            n *= 10;
            n = n % m;
            if (n == 0) return 0;
            if (v.indexOf(n) >= 0) return v.size() - v.indexOf(n);  //填空
        }
    }
}
